home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EuroCD 3
/
EuroCD 3.iso
/
Programming
/
Amos
/
AMOSList-0497
/
AMOSLIST
/
000133_amos-request@svcs1.digex.net_Wed Apr 16 08:11:03 1997.msg
< prev
next >
Wrap
Text File
|
1998-06-24
|
3KB
|
63 lines
Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
by mail1.access.digex.net (8.8.5/8.8.5) with ESMTP id IAA14100
for <mcox@access.digex.net>; Wed, 16 Apr 1997 08:11:02 -0400 (EDT)
Received: (from daemon@localhost)
by svcs1.digex.net (8.8.5/8.8.5) id GAA21726
for amos-out; Wed, 16 Apr 1997 06:19:29 -0400 (EDT)
Received: from mail1.access.digex.net (mail1.access.digex.net [205.197.247.2])
by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id GAA21723
for <amos-list@svcs1.digex.net>; Wed, 16 Apr 1997 06:19:28 -0400 (EDT)
Received: from amalthea.salford.ac.uk (amalthea.salford.ac.uk [146.87.255.61])
by mail1.access.digex.net (8.8.5/8.8.5) with ESMTP id GAA26782
for <amos-list@access.digex.net>; Wed, 16 Apr 1997 06:19:15 -0400 (EDT)
Received: from cms-notes-a.salford.ac.uk (actually host cms-notes-a.cms.salford.ac.uk)
by amalthea.salford.ac.uk with SMTP (PP);
Wed, 16 Apr 1997 11:18:35 +0100
Received: by cms-notes-a.salford.ac.uk(Lotus SMTP MTA v1.06 (346.4 3-18-1997))
id 8025647B.003894B8 ; Wed, 16 Apr 1997 11:18:00 +0100
X-Lotus-FromDomain: UNIVERSITY OF SALFORD
From: Lee S Howarth <L.S.Howarth@cms.salford.ac.uk>
To: amos-list@access.digex.net
Message-ID: <8025647B.003751B3.00@cms-notes-a.salford.ac.uk>
Date: Wed, 16 Apr 1997 11:12:58 +0100
Subject: Re:Line Problems
Mime-Version: 1.0
Content-type: text/plain; charset=us-ascii
Status: O
X-Status:
Reply to Mush...
I think I know what you are trying to do in your box-line thing so I will
try and explain two methods I know...
To get the Y position of the slope as you go from one point to another can
be solved by using either a linedraw routine or calculating the difference
of Y position on the slope and adding it (negative gradients as well) to
the current Y position...
The first method can be done by using a Bresnham (i think thats how you
spell it ;-) line draw, this basically is a line draw routine that uses
only integer numbers... you give the line routine the start and end (the
top and bottom of you box) and for every increment in the x position, you
will be able to get the y position, and becoz the box can probably be
reflected horizontally you can just use -ypos+screenheight to get the
bottom of the box Y co-ord.
The second method means getting the gradient of the slope and doing a loop
from the start X to the end X of the box and for every point inbetween,
increment the y position by the difference in heght between each pixel,
this does mean using floating point numbers thought so it`s VERY slow, but
then again, so was the first method(slow I mean...) but at least they work
:-)
I will try and post the bresenham linedraw routine... I use it for
raycasting at the moment(that will soon change though)
Lee Howarth